cmake_minimum_required(VERSION 3.22)

project(HelloSLAM)
# 将 libHelloSLAM.cpp 编译成名为 hello 的库 (默认生成静态库)
add_library(hello libHelloSLAM.cpp)
# 将 libHelloSLAM.cpp 编译成名为 hello_shared 的库 (共享库)
add_library(hello_shared SHARED libHelloSLAM.cpp)

add_executable(helloSLAM helloSLAM.cpp)
add_executable(useHello useHello.cpp)

target_link_libraries(useHello hello_shared)
# set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_C_STANDARD 99)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)

# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O2 -Wall")
# 创建的build文件夹的上层文件夹创建bin文件夹，也就是根目录下创建bin文件夹用来存放可执行文件
# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# set(OpenCV_DIR "/home/icebot/Lib/OpenCV_install/lib/cmake/opencv4")
# find_package(OpenCV REQUIRED)
# 包含OpenCV头文件
# include_directories(${OpenCV_INCLUDE_DIRS})

# 头文件所在地
# include_directories(include)

# 库文件所在地
# add_subdirectory(src)

# 对生成的可执行文件命名
# set(EXECUTABLE_NAME test)
# 选中工作空间中需要调用的测试文件
# set(WORKING_DIRECTORY
  # work/main.cpp
  # work/camera_adjust.cpp
# )

# 生成可执行文件
# add_executable(${EXECUTABLE_NAME} ${WORKING_DIRECTORY})
# 将生成的可执行文件对OpenCV库进行链接
# target_link_libraries(${EXECUTABLE_NAME} ${OpenCV_LIBS})

#将生成的可执行文件对库文件进行链接
# target_link_libraries(${EXECUTABLE_NAME} libcpp)/